TITLE input5_3.asc: UAV Heading controller
// Input for Lab5 'UAV Controlled'
// Heading angle doublet
OPTIONS y_scrn n_comscrn y_events n_tabout y_plot y_traj n_merge y_doc 
MODULES
	environment		def,init,exec
	aerodynamics	def,exec	
	propulsion		def,init,exec	
	forces			def,exec	
	newton			def,init,exec	
	control			def,exec	
END
TIMING
	scrn_step 1
	plot_step 0.05
	traj_step 0.5
	int_step 0.05
END
VEHICLES 1
	CRUISE3 UAV
		//Initial conditions
			lonx  14.7    //Vehicle longitude - deg  module newton
			latx  35.4    //Vehicle latitude - deg  module newton
			alt  3000    //Vehicle altitude - m  module newton
			psivgx  90    //Vehicle heading angle - deg  module newton
			thtvgx  0    //Vehicle flight path angle - deg  module newton
			dvbe  197    //Vehicle speed - m/s  module newton
		//Aerodynamics
			AERO_DECK cruise3_aero_deck.asc
		//Mass properties and propulsion
			mprop  4    //'int' Mode switch - ND  module propulsion
			mach_com  0.6    //Commanded Mach number - ND  module propulsion
			mass_init  1000    //Initial vehicle mass - kg  module propulsion
			fuel_init  150    //Initial fuel - kg  module propulsion
			gfthm  893620    //Gain of Mach hold loop - N  module propulsion
			tfth  1    //Time constant of Mach hold loop - s  module propulsion
			PROP_DECK cruise3_prop_deck.asc
		//autopilot
			mcontrol  11    //'int' Mode switch - ND  module control
		//flight path angle controller
			thtvgcx  1.2    //Commanded flight path angle - deg  module control
			gain_thtvg  30    //Flight path angle hold control gain - g/deg  module control
			alpposlimx  15    //Angle of attack positive limiter - deg  module control
			alpneglimx  -10    //Angle of attack negative limiter - deg  module control
		//bank-angle controller
			philimx  70    //Bank angle command limiter - deg  module control
			tphi  0.5    //Time constant of bank angle response - sec  module control
		//heading controller
			psivgcx  90    //Commanded heading angle - deg  module control
			gain_psivg  12.0    //Heading angle hold control gain - ND  module control
			IF time > 5
				psivgcx  95    //Commanded heading angle - deg  module control
			ENDIF
			IF time > 15
				psivgcx  90    //Commanded heading angle - deg  module control
			ENDIF
			IF time > 25
				psivgcx  85    //Commanded heading angle - deg  module control
			ENDIF
			IF time > 35
				psivgcx  90    //Commanded heading angle - deg  module control
			ENDIF
	END
ENDTIME 45
STOP
